function [W, t, psd]= cn(maxT, nPt, func, nPath)
    dt = maxT/nPt; tList = dt*(0:(nPt-1));
    df = 1./maxT;  fList = df*(1:nPt);
    
    lpsd = func(fList);
    pwrList = [lpsd lpsd] .* randn(nPath, 2*nPt);

    cosList = cos(2.0*pi* fList .* tList.');
    sinList = sin(2.0*pi* fList .* tList.');
    W = [cosList sinList]*(pwrList.');
    t = tList;
    psd = lpsd.*lpsd;
end